//
//  SecondMenuController.m
//  FlashCards
//
//  Created by Home on 2/2/12.
//  Copyright (c) 2012 __MyCompanyName__. All rights reserved.
//
// *****************************************************************************
// This Controller is connected to the storyboard view titled SecondMenu.
// The only thing this controller currently adds to the defaul capability 
// is to update the FlashCard singleton before loading the SecondMenu view.
// *****************************************************************************


#import "SecondMenuController.h"
#import "FlashCards.h"
#import "FlashCardViewControllerSB.h"
#import "MyViewControllerV2.h"
#import "DebugMacro.h"



@implementation SecondMenuController

- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil
{
    self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil];
    if (self) {
        // Custom initialization
    }
    return self;
}

- (void)didReceiveMemoryWarning
{
    // Releases the view if it doesn't have a superview.
    [super didReceiveMemoryWarning];
    
    // Release any cached data, images, etc that aren't in use.
}

#pragma mark - View lifecycle


// Implement loadView to create a view hierarchy programmatically, without using a nib.
/*
- (void)loadView
{
   
}
*/
- (void)viewWillAppear:(BOOL)animated {

    [super viewWillAppear:animated];

	
}



// Implement viewDidLoad to do additional setup after loading the view, typically from a nib.
- (void)viewDidLoad
{
    
    
    [super viewDidLoad];
}


- (void)viewDidUnload
{
    [super viewDidUnload];
    // Release any retained subviews of the main view.
    // e.g. self.myOutlet = nil;
}

- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
{
    // Return YES for supported orientations
    return (interfaceOrientation == UIInterfaceOrientationPortrait);
}

- (IBAction)loadFlashCards:(id)sender {
    
    [FlashCards sharedFlashCards].currentCardNumber = 1;
    
    UIStoryboard *storyboard = self.storyboard;

    // This is a regular view controller
    FlashCardViewControllerSB *svc = [storyboard instantiateViewControllerWithIdentifier:@"FlashCardSBController"];
    
    // configure the new view controller explicitly here.
    
    [self presentViewController:svc animated:YES completion:nil];
    
    
    

}

// This is the button that loads the best version, which fully uses the Story Board...

- (IBAction)loadScrollViewFlashCard:(id)sender {
    
    
    [FlashCards sharedFlashCards].currentCardNumber = 1;
    
    UIStoryboard *storyboard = self.storyboard;
    
    // Load the scroll view controller version
    MyViewControllerV2 *svc = [storyboard instantiateViewControllerWithIdentifier:@"ScrollViewHolder"];
    
    // configure the new view controller explicitly here.
    
    [self presentViewController:svc animated:YES completion:nil];
    

}
@end
